<?php
class InfoAction extends Action {
	public function teacherinfo()
	{
		$Dao=D("msg_teacher");
		$list=$Dao->select();
		$this->assign("list",$list);
		$this->display();
	}
	public function studentmsg()
	{
		$Dao=D('msg_student');
		$condition['account']=session('account');
		$list=$Dao->where($condition)->order('start')->select();
		$this->assign('list',$list);
		$this->display();
	}
	public function studentdel()
	{
		$Dao=D('msg_student');
		$condition['grade']=$_GET[grade];
		$condition['account']=session('account');;
		$condition['subject']=$_GET[subject];
		$condition['start']=$_GET[start];
		$condition['end']=$_GET[end];
		$result = $Dao->where($condition)->delete();
		if($result !== false){
			$this->ajaxReturn("true");
		}else{
			$this->ajaxReturn("false");
		}
	} 
	public function studentcreate()
	{
		$Dao=D('msg_student');
		$condition['grade']=$_GET[grade];
		$condition['account']=session('account');
		$condition['subject']=$_GET[subject];
		$condition['start']=$_GET[start];
		$condition['end']=$_GET[end];
		if($Dao->add($condition)){
			$this->ajaxReturn("true");
		} else {
			$this->ajaxReturn("false");
		}
	}
}

?>